home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Updates / AddOns / WormWars / Source / system.h < prev    next >
C/C++ Source or Header  |  1999-11-08  |  58KB  |  3,247 lines

  1. /* $Filename:       WormWars/Source/system.h $
  2.  * $VER:            WormWars 4.1 (1.6.99) $
  3.  * $Description:    Header file for system.c $
  4.  *
  5.  * © Copyright 1993-1999 James R. Jacobs of Amigan Software.
  6.  * Freely distributable.
  7.  *
  8.  * Beta version.
  9.  
  10. #INCLUDES -------------------------------------------------------------- */
  11.  
  12. #include <exec/exec.h>
  13. #include <intuition/intuition.h>
  14. #include <intuition/gadgetclass.h>        // STRINGA_ReplaceMode
  15. #include <libraries/asl.h>                // ASL_FileRequest
  16. #include <libraries/gadtools.h>            // struct StringInfo
  17. #include <devices/gameport.h>            // struct GamePortTrigger
  18. #include <devices/input.h>
  19. #include <devices/inputevent.h>
  20. #include <dos/dosextens.h>                // struct Process
  21. #include <graphics/displayinfo.h>        // PAL_MONITOR_ID, etc.
  22. #include <exec/types.h>
  23. #include <exec/memory.h>
  24. #include <devices/audio.h>
  25. #include <dos/dos.h>
  26. #include <libraries/iffparse.h>
  27.  
  28. #include <stdio.h>                        // FILE, printf()
  29. #include <stdlib.h>                        // EXIT_SUCCESS, EXIT_FAILURE
  30.  
  31. #include "diff.h"
  32. #include "same.h"
  33. #include "libproto.h"
  34.  
  35. // say() arguments (hidden messages)
  36.  
  37. #define  FIRSTLISA              "Lisa is gorgeous!"
  38. #define SECONDLISA              "My beloved! :-)"
  39.  
  40. // statistics text
  41.  
  42. #define STATSINGLE              "Single"
  43. #define STATTRIPLE              "Triple"
  44. #define STATQUINTUPLE           "Quint."
  45. #define STATSEPTUPLE            "Sept. "
  46. #define STATFAST                "Fast  "
  47. #define STATNORMAL              "Normal"
  48. #define STATSLOW                "Slow  "
  49. #define STATVERYFAST            "V.Fast"
  50. #define STATVERYSLOW            "V.Slow"
  51.  
  52. #define ALTJUMP                       5
  53. #define LIFEMODULO                1000
  54.  
  55. /* #DEFINES ---------------------------------------------------------------
  56.  
  57. miscellaneous */
  58.  
  59. #define ABOUTLINES            6
  60. #define ABOUTSHADOW            DARKBLUE
  61. #define ABOUTSHINE            BLUE
  62.  
  63. #define ANIMDELAY            40000L
  64. #define SEGMENTS            17
  65.  
  66. /* constant strings
  67.  
  68. screen/window titles */
  69.  
  70. #define ASLOPENHAIL         "Open Fieldset"
  71. #define ASLSAVEHAIL            "Save Fieldset"
  72. #define TITLEBAR            "Worm Wars 4.1"
  73.  
  74. // pathnames, etc.
  75.  
  76. #define EMERGENCYNAME        "Error.fset"
  77. #define MEDMODULE            "WormWars.MED"
  78. #define PATTERN                "(#?.fset)"
  79.  
  80. // alerts (fatal errors) used multiple times
  81.  
  82. #define ALERTTIMERVALUE         "\0\20\20Worm Wars: Can't allocate timer value structure!\0"
  83. #define ALERTMENUCREATE            "\0\20\20Worm Wars: Can't create menus!\0"
  84. #define ALERTMENULAYOUT            "\0\20\20Worm Wars: Can't lay out menus!\0"
  85.  
  86. #define NUMKEYS            29
  87. #define QUEUELIMIT        15
  88. #define UNDERLINEOFFSET    (46 + STARTYPIXEL)
  89.  
  90. // object descriptions
  91.  
  92. #define FIRSTDESCX        120        // these X/Ys are in pixels
  93. #define SECONDDESCX        (SCREENXPIXEL - FIRSTDESCX)
  94. #define DESCY              3
  95.  
  96. // pseudo-gadgets
  97.  
  98. #define GADGETX            -3
  99. #define GOLDGADGET        (FIELDY / 2 - 11)
  100. #define SILVERGADGET    (FIELDY / 2 -  8)
  101. #define EMPTYGADGET        (FIELDY / 2 -  5)
  102. #define WOODGADGET        (FIELDY / 2 -  2)
  103. #define STONEGADGET        (FIELDY / 2 +  1)
  104. #define ONEGADGET        (FIELDY / 2 +  4)
  105. #define TWOGADGET        (FIELDY / 2 +  7)
  106. #define STARTGADGET        (FIELDY / 2 + 10)
  107.  
  108. // menus
  109.  
  110. #define PROJECTSTART     0        // array offsets of menu headers
  111. #define TOOLSSTART         9
  112. #define LEVELSTART        12
  113.  
  114. #define MN_PROJECT        0
  115. #define MN_TOOLS        1
  116. #define MN_LEVEL        2
  117. #define IN_NEW            0
  118. #define IN_OPEN            1
  119. #define IN_SAVE            2
  120. #define IN_SAVEAS        3
  121. #define IN_ABOUT        5
  122. #define IN_QUIT            7
  123. #define IN_TS            0
  124. #define IN_FE            1
  125. #define IN_INSERT        0
  126. #define IN_DELETE        1
  127. #define IN_ERASE        2
  128. #define IN_APPEND        3
  129.  
  130. // window dimensions
  131.  
  132. #define ABOUTXPIXEL                312
  133. #define ABOUTYPIXEL                106
  134.  
  135. // ARRAYS -----------------------------------------------------------------
  136.  
  137. UWORD chip CustomPointer[] =
  138. {    0x0000, 0x0000,        // reserved
  139.  
  140.     0xF000, 0xF800,        // 1st row 1st plane, 1st row 2nd plane
  141.     0xF000, 0x8800,        // 2nd row 1st plane, 2nd row 2nd plane
  142.     0xF000, 0x8800,        // 3rd row 1st plane, 3rd row 2nd plane
  143.     0xF000, 0x8800,        // 4th row 1st plane, 4th row 2nd plane
  144.     0xF000, 0x8800,        // 5th row 1st plane, 5th row 2nd plane
  145.     0x8000, 0xF800,        // 6th row 1st plane, 6th row 2nd plane
  146.  
  147.     0x0000, 0x0000        // reserved
  148. };
  149.  
  150. STRPTR objectdesc[LASTOBJECT + 1] =
  151. {    "AFFIXER: Stops protectors rotating.",
  152.     "AMMO: 1-6 bullets.",
  153.     "ARMOUR: Immune to most damage.",
  154.     "BIAS: Rules changes in your favour.",
  155.     "BOMB: An explosion.",
  156.     "BONUS: Random letter.",
  157.     "GROWER: Enlarges silver and gold.",
  158.     "ICE: Freezes everything except you.",
  159.     "LIFE: 1-6 lives.",
  160.     "MISSILE: A guided missile.",
  161.     "MULTIPLIER: More points.",
  162.     "NITRO: Improved movement.",
  163.     "POWER: Thicker bullets.",
  164.     "PROTECTOR: An orbiting companion.",
  165.     "SLAYER: Smart bomb.",
  166.     "SWITCHER: Changes tail colours.",
  167.     "HEALER: 100/200 lives.",
  168.     "TONGUE: Convert tails.",
  169.     "TREASURE: Treasure level."
  170. };
  171.  
  172. UWORD chip ImageData[ARRAYSIZE + 1][SQUAREY * 4] =
  173. {    // This definition must precede definition of Image...
  174.   {    0x7F00,        // AFFIXER
  175.     0xFF80,
  176.     0xFF80,
  177.     0xFF80,
  178.     0x7F00,
  179.     0x3E00,
  180.     0x7F00,
  181.     0x9C80,
  182.     0xFF80,
  183.     0xDD80,
  184.     0x6300,
  185.     0x3E00,
  186.     0x7F00,
  187.     0x9C80,
  188.     0xFF80,
  189.     0xDD80,
  190.     0x6300,
  191.     0x3E00,
  192.     0x0000,
  193.     0x0000,
  194.     0x0000,
  195.     0x0000,
  196.     0x0000,
  197.     0x0000 },
  198.   {    0x0800,        // AMMO
  199.     0x0000,
  200.     0x0800,
  201.     0x0000,
  202.     0x0800,
  203.     0x0000,
  204.     0x0000,
  205.     0x0800,
  206.     0x0000,
  207.     0x0800,
  208.     0x0000,
  209.     0x1C00,
  210.     0x0800,
  211.     0x0800,
  212.     0x0800,
  213.     0x0800,
  214.     0x0800,
  215.     0x1C00,
  216.     0x0000,
  217.     0x0000,
  218.     0x0000,
  219.     0x0000,
  220.     0x0000,
  221.     0x0000 },
  222.   {    0x8080,        // ARMOUR
  223.     0xC180,
  224.     0xF780,
  225.     0xFF80,
  226.     0x9C80,
  227.     0xFF80,
  228.     0x0000,
  229.     0x0000,
  230.     0x0000,
  231.     0x0000,
  232.     0x0000,
  233.     0x0000,
  234.     0x8080,
  235.     0xC180,
  236.     0xF780,
  237.     0x9C80,
  238.     0x9C80,
  239.     0xFF80,
  240.     0x0000,
  241.     0x0000,
  242.     0x0000,
  243.     0x0000,
  244.     0x0000,
  245.     0x0000 },
  246.   {    0x0180,        // BIAS
  247.     0x0180,
  248.     0x0300,
  249.     0xC600,
  250.     0x6C00,
  251.     0x3800,
  252.     0x0000,
  253.     0x0000,
  254.     0x0000,
  255.     0x0000,
  256.     0x0000,
  257.     0x0000,
  258.     0x0180,
  259.     0x0180,
  260.     0x0300,
  261.     0xC600,
  262.     0x6C00,
  263.     0x3800,
  264.     0x0000,
  265.     0x0000,
  266.     0x0000,
  267.     0x0000,
  268.     0x0000,
  269.     0x0000 },
  270.   {    0x0600,        // BOMB
  271.     0x0000,
  272.     0x1C00,
  273.     0x6300,
  274.     0x4100,
  275.     0x3E00,
  276.     0x0200,
  277.     0x0800,
  278.     0x1C00,
  279.     0x6300,
  280.     0x4100,
  281.     0x3E00,
  282.     0x0600,
  283.     0x0000,
  284.     0x0000,
  285.     0x1C00,
  286.     0x3E00,
  287.     0x0000,
  288.     0x0200,
  289.     0x0800,
  290.     0x0000,
  291.     0x0000,
  292.     0x0000,
  293.     0x0000 },
  294.   {    0x0000,        // BONUS
  295.     0x0000,
  296.     0x0000,
  297.     0x0000,
  298.     0x0000,
  299.     0x0000,
  300.     0x0180,
  301.     0x0180,
  302.     0x0300,
  303.     0xC600,
  304.     0x6C00,
  305.     0x3800,
  306.     0x0180,
  307.     0x0180,
  308.     0x0300,
  309.     0xC600,
  310.     0x6C00,
  311.     0x3800,
  312.     0x0000,
  313.     0x0000,
  314.     0x0000,
  315.     0x0000,
  316.     0x0000,
  317.     0x0000 },
  318.   {    0x3F00,        // GROWER
  319.     0x4800,
  320.     0x3E00,
  321.     0x0900,
  322.     0x7E00,
  323.     0x0800,
  324.     0x0000,
  325.     0x0000,
  326.     0x0000,
  327.     0x0000,
  328.     0x0000,
  329.     0x0000,
  330.     0x0000,
  331.     0x0000,
  332.     0x0000,
  333.     0x0000,
  334.     0x0000,
  335.     0x0000,
  336.     0x3700,
  337.     0x4000,
  338.     0x3600,
  339.     0x0100,
  340.     0x7600,
  341.     0x0000 },
  342.   {    0x0000,        // ICE
  343.     0x3E00,
  344.     0x7C00,
  345.     0x7C00,
  346.     0x7C00,
  347.     0x0000,
  348.     0x0000,
  349.     0x0000,
  350.     0x0000,
  351.     0x0000,
  352.     0x0000,
  353.     0x0000,
  354.     0x0000,
  355.     0x3F00,
  356.     0x0300,
  357.     0x0300,
  358.     0x0200,
  359.     0x0000,
  360.     0x0000,
  361.     0x3F00,
  362.     0x0300,
  363.     0x0300,
  364.     0x0200,
  365.     0x0000 },
  366.   {    0x007F,        // LIFE
  367.     0x637F,
  368.     0x777F,
  369.     0x1C7F,
  370.     0x087F,
  371.     0x007F,
  372.     0x6300,
  373.     0xF780,
  374.     0xFF80,
  375.     0x7F00,
  376.     0x1C00,
  377.     0x0800,
  378.     0x0000,
  379.     0x0000,
  380.     0x0000,
  381.     0x0000,
  382.     0x0000,
  383.     0x0000,
  384.     0x637F,
  385.     0xF7FF,
  386.     0xFFFF,
  387.     0x7F7F,
  388.     0x1C7F,
  389.     0x087F },
  390.   {    0x0000,        // MISSILE
  391.     0x0000,
  392.     0x0000,
  393.     0x0000,
  394.     0x0000,
  395.     0x0000,
  396.     0x8780,
  397.     0xCC00,
  398.     0x7F00,
  399.     0x0980,
  400.     0x1880,
  401.     0xF080,
  402.     0x8780,
  403.     0xCC00,
  404.     0x7F00,
  405.     0x0980,
  406.     0x1880,
  407.     0xF080,
  408.     0x0000,
  409.     0x0000,
  410.     0x0000,
  411.     0x0000,
  412.     0x0000,
  413.     0x0000 },
  414.   {    0x0F00,        // MULTIPLIER
  415.     0x9080,
  416.     0x6100,
  417.     0x9200,
  418.     0x0400,
  419.     0x0F80,
  420.     0x0000,
  421.     0x9000,
  422.     0x6000,
  423.     0x9000,
  424.     0x0000,
  425.     0x0000,
  426.     0x0F00,
  427.     0x9080,
  428.     0x6100,
  429.     0x9200,
  430.     0x0400,
  431.     0x0F80,
  432.     0x0000,
  433.     0x0000,
  434.     0x0000,
  435.     0x0000,
  436.     0x0000,
  437.     0x0000 },
  438.   {    0x0800,        // NITRO
  439.     0x1C00,
  440.     0x2A00,
  441.     0x0800,
  442.     0x1C00,
  443.     0x0800,
  444.     0x0000,
  445.     0x0000,
  446.     0x0000,
  447.     0x0000,
  448.     0x1400,
  449.     0x1400,
  450.     0x0000,
  451.     0x0000,
  452.     0x1400,
  453.     0x1400,
  454.     0x0000,
  455.     0x0000,
  456.     0x0000,
  457.     0x0000,
  458.     0x0000,
  459.     0x0000,
  460.     0x0000,
  461.     0x0000 },
  462.   {    0x0800,        // POWER
  463.     0x0E00,
  464.     0x0F80,
  465.     0x7800,
  466.     0x3800,
  467.     0x0800,
  468.     0x0000,
  469.     0x3000,
  470.     0xF000,
  471.     0x0700,
  472.     0x0600,
  473.     0x0000,
  474.     0x0800,
  475.     0x3E00,
  476.     0xFF80,
  477.     0x7F00,
  478.     0x3E00,
  479.     0x0800,
  480.     0x0000,
  481.     0x0000,
  482.     0x0000,
  483.     0x0000,
  484.     0x0000,
  485.     0x0000 },
  486.   {    0x0000,        // PROTECTOR
  487.     0x6300,
  488.     0x0000,
  489.     0x2200,
  490.     0x1C00,
  491.     0x0000,
  492.     0x7F00,
  493.     0x9C80,
  494.     0xFF80,
  495.     0xDD80,
  496.     0x6300,
  497.     0x3E00,
  498.     0x7F00,
  499.     0x9C80,
  500.     0xFF80,
  501.     0xDD80,
  502.     0x6300,
  503.     0x3E00,
  504.     0x0000,
  505.     0x0000,
  506.     0x0000,
  507.     0x0000,
  508.     0x0000,
  509.     0x0000 },
  510.   {    0x4880,        // SLAYER
  511.     0x0000,
  512.     0x8000,
  513.     0x0080,
  514.     0x0000,
  515.     0x8900,
  516.     0x4880,
  517.     0x0000,
  518.     0x9C00,
  519.     0x1C80,
  520.     0x0000,
  521.     0x8900,
  522.     0x4880,
  523.     0x0000,
  524.     0x9C00,
  525.     0x1C80,
  526.     0x0000,
  527.     0x8900,